/**
 * 根据路径在router数组中找到path对应的名字
 * path = 路径
 * routerList = 路由数组
 */
let data = {
    name: '',
    icon: ''
}
export function findRouterTitleName(path, routerList) {
    for (let i = 0; i < routerList.length; i++) {
        if (routerList[i].children) {
            if (routerList[i].children.length > 0 || routerList[i].path === path) {
                if (routerList[i].path === path && routerList[i].children.length < 1) {
                    data.name = routerList[i].name
                    data.icon = routerList[i].icon
                    break
                }
                findRouterTitleName(path, routerList[i].children)
            }
        }
    }
    return data
}